package atguigu07.object.equals.apply;

import java.util.Objects;

/**
 * ClassName: Account
 * Package: atguigu07.object.equals.apply
 * Description:
 *
 * @Author BuTang
 * @Create 2023/3/8 20:23
 * @Version 1.0
 */
public class Account {
    private double balance ;
    private String account;

    public Account(double balance, String account) {
        this.balance = balance;
        this.account = account;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Account account1 = (Account) o;
        return Double.compare(account1.balance, balance) == 0 && Objects.equals(account, account1.account);
    }

    @Override
    public int hashCode() {
        return Objects.hash(balance, account);
    }
}
